#进入虚拟机后执行如下命令，其中IPADDR与GATEWAY，要与宿主机br0的ip对应，保证相同gateway下的不同IPADDR
eth0=`ip a|grep mtu|grep -v lo|awk -F ': ' '{print $2}'|awk NR==1`
ether=`ip a $eth0|grep ether|awk -F ' ' '{print $2}'`
UUID=`cat /etc/sysconfig/network-scripts/ifcfg-$eth0 |grep UUID|awk -F '=' '{print $2}'`

cat > /etc/sysconfig/network-scripts/ifcfg-$eth0 <<EOF
TYPE=Ethernet
BOOTPROTO=static
IPADDR=171.16.37.53 #与宿主机在相同子网环境下的ip
GATEWAY=171.16.0.1 #和宿主机相同的gateway
NETMASK=255.255.0.0
DEFROUTE=yes
PEERROUTES=yes
NAME=$eth0
UUID=$UUID
DEVICE=$eth0
ONBOOT=yes
EOF

ifup $eth0

cat > /etc/resolv.conf <<EOF
search localdomain
nameserver 114.114.114.114
nameserver 8.8.8.8
EOF

#route add default gw 171.16.37.24
#route add default gw 171.16.0.1